export function discountPercentage(input) {
  // 确保输入是一个有效的数字
  if (typeof input !== 'number' || isNaN(input)) {
    return "";
  }
  // 将输入的数字转换为折扣
  const discount = parseFloat((input / 10).toFixed(1));
  return `${discount}折`;
}

export const discountOptions = [
  {
    value: 100,
    label: "无折扣"
  },
  {
    value: 99,
    label: "9.9折"
  },
  {
    value: 98,
    label: "9.8折"
  },
  {
    value: 97,
    label: "9.7折"
  },
  {
    value: 96,
    label: "9.6折"
  },
  {
    value: 95,
    label: "9.5折"
  },
  {
    value: 94,
    label: "9.4折"
  },
  {
    value: 93,
    label: "9.3折"
  },
  {
    value: 92,
    label: "9.2折"
  },
  {
    value: 91,
    label: "9.1折"
  },
  {
    value: 90,
    label: "9.0折"
  },
  {
    value: 89,
    label: "8.9折"
  },
  {
    value: 88,
    label: "8.8折"
  },
  {
    value: 87,
    label: "8.7折"
  },
  {
    value: 86,
    label: "8.6折"
  },
  {
    value: 85,
    label: "8.5折"
  },
  {
    value: 84,
    label: "8.4折"
  },
  {
    value: 83,
    label: "8.3折"
  },
  {
    value: 82,
    label: "8.2折"
  },
  {
    value: 81,
    label: "8.1折"
  },
  {
    value: 80,
    label: "8.0折"
  },
  {
    value: 79,
    label: "7.9折"
  },
  {
    value: 78,
    label: "7.8折"
  },
  {
    value: 77,
    label: "7.7折"
  },
  {
    value: 76,
    label: "7.6折"
  },
  {
    value: 75,
    label: "7.5折"
  },
  {
    value: 74,
    label: "7.4折"
  },
  {
    value: 73,
    label: "7.3折"
  },
  {
    value: 72,
    label: "7.2折"
  },
  {
    value: 71,
    label: "7.1折"
  },
  {
    value: 70,
    label: "7.0折"
  },
  {
    value: 69,
    label: "6.9折"
  },
  {
    value: 68,
    label: "6.8折"
  },
  {
    value: 67,
    label: "6.7折"
  },
  {
    value: 66,
    label: "6.6折"
  },
  {
    value: 65,
    label: "6.5折"
  },
  {
    value: 64,
    label: "6.4折"
  },
  {
    value: 63,
    label: "6.3折"
  },
  {
    value: 62,
    label: "6.2折"
  },
  {
    value: 61,
    label: "6.1折"
  },
  {
    value: 60,
    label: "6.0折"
  },
  {
    value: 59,
    label: "5.9折"
  },
  {
    value: 58,
    label: "5.8折"
  },
  {
    value: 57,
    label: "5.7折"
  },
  {
    value: 56,
    label: "5.6折"
  },
  {
    value: 55,
    label: "5.5折"
  },
  {
    value: 54,
    label: "5.4折"
  },
  {
    value: 53,
    label: "5.3折"
  },
  {
    value: 52,
    label: "5.2折"
  },
  {
    value: 51,
    label: "5.1折"
  },
  {
    value: 50,
    label: "5.0折"
  },
  {
    value: 49,
    label: "4.9折"
  },
  {
    value: 48,
    label: "4.8折"
  },
  {
    value: 47,
    label: "4.7折"
  },
  {
    value: 46,
    label: "4.6折"
  },
  {
    value: 45,
    label: "4.5折"
  },
  {
    value: 44,
    label: "4.4折"
  },
  {
    value: 43,
    label: "4.3折"
  },
  {
    value: 42,
    label: "4.2折"
  },
  {
    value: 41,
    label: "4.1折"
  },
  {
    value: 40,
    label: "4.0折"
  },
  {
    value: 39,
    label: "3.9折"
  },
  {
    value: 38,
    label: "3.8折"
  },
  {
    value: 37,
    label: "3.7折"
  },
  {
    value: 36,
    label: "3.6折"
  },
  {
    value: 35,
    label: "3.5折"
  },
  {
    value: 34,
    label: "3.4折"
  },
  {
    value: 33,
    label: "3.3折"
  },
  {
    value: 32,
    label: "3.2折"
  },
  {
    value: 31,
    label: "3.1折"
  },
  {
    value: 30,
    label: "3.0折"
  },
  {
    value: 29,
    label: "2.9折"
  },
  {
    value: 28,
    label: "2.8折"
  },
  {
    value: 27,
    label: "2.7折"
  },
  {
    value: 26,
    label: "2.6折"
  },
  {
    value: 25,
    label: "2.5折"
  },
  {
    value: 24,
    label: "2.4折"
  },
  {
    value: 23,
    label: "2.3折"
  },
  {
    value: 22,
    label: "2.2折"
  },
  {
    value: 21,
    label: "2.1折"
  },
  {
    value: 20,
    label: "2.0折"
  },
  {
    value: 19,
    label: "1.9折"
  },
  {
    value: 18,
    label: "1.8折"
  },
  {
    value: 17,
    label: "1.7折"
  },
  {
    value: 16,
    label: "1.6折"
  },
  {
    value: 15,
    label: "1.5折"
  },
  {
    value: 14,
    label: "1.4折"
  },
  {
    value: 13,
    label: "1.3折"
  },
  {
    value: 12,
    label: "1.2折"
  },
  {
    value: 11,
    label: "1.1折"
  },
  {
    value: 10,
    label: "1.0折"
  },
  {
    value: 9,
    label: "0.9折"
  },
  {
    value: 8,
    label: "0.8折"
  },
  {
    value: 7,
    label: "0.7折"
  },
  {
    value: 6,
    label: "0.6折"
  },
  {
    value: 5,
    label: "0.5折"
  },
  {
    value: 4,
    label: "0.4折"
  },
  {
    value: 3,
    label: "0.3折"
  },
  {
    value: 2,
    label: "0.2折"
  },
  {
    value: 1,
    label: "0.1折"
  }
];
